package com.inibb.app.pagination.dto;

import java.util.ArrayList;
import java.util.List;



public class PageFilter {
    private int rowStart;
    
    private int rowEnd;

	public int getRowEnd() {
		return rowEnd;
	}

	public void setRowEnd(int rowEnd) {
		this.rowEnd = rowEnd;
	}

	public int getRowStart() {
		return rowStart;
	}

	public void setRowStart(int rowStart) {
		this.rowStart = rowStart;
	}
	
    private List<DTOFilter> filters = new ArrayList<DTOFilter>() ;

	public List<DTOFilter> getFilters() {
		return filters;
	}

	public void setFilters(List<DTOFilter> filters) {
		this.filters = filters;
	}


    public void addFilter(String property, Object value) {
        filters.add(new DTOFilter(property, value));
    }
    
    public void addFilter(String property, Object value, int operationType) {
    	DTOFilter filter = new DTOFilter(property, value);
    	filter.setOperationType( operationType );
        filters.add( filter );
    }
    
    public void addFilter(DTOFilter filter) {
    	filters.add( filter );
    }

    public void addPageFilter (PageFilter pageFilter) {
    	filters.addAll( pageFilter.getFilters() );
    }
}
